# 字典类型
import json
from datetime import datetime

from sqlalchemy import func
from sqlalchemy.orm import aliased

from apps.model.baseModel import BaseModel
from apps.settingApi.api.lessees.model import lesseesModel
from comm.sqlalchemyConfig import db


class fileModel(db.Model):
    """
    文件
    """
    __tablename__ = 'tx_file'
    id = db.Column(db.String(100), primary_key=True, autoincrement=False,doc='id')
    name = db.Column(db.String(125), nullable=False,doc='文件名称')
    postfix = db.Column(db.String(125), nullable=False,doc='文件后缀')
    size = db.Column(db.Numeric(20, 6), nullable=False,doc='文件大小')
    url = db.Column(db.String(125), nullable=False,doc='文件地址')
    rem = db.Column(db.Text, nullable=True, default='', doc='备注')
    lessees_id = db.Column(db.String(100), nullable=False, doc='归属租户')
    create_user = db.Column(db.String(50), nullable=True)
    create_time = db.Column(db.DateTime, default=datetime.now, nullable=True)
    update_user = db.Column(db.String(50), nullable=True)
    update_time = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now, nullable=True)

